<template>
  <el-container class="main_container">
    <el-header>
      <div class="left_box">
        <span>教师评价管理系统</span>
      </div>
      <div class="right_box">
        <el-dropdown>
          <span class="el-dropdown-link">
            你好，欢迎回来<i class="el-icon-arrow-down el-icon--right"></i>
          </span>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item class="dd_item" icon="el-icon-s-custom"
              >个人信息</el-dropdown-item
            >
            <el-dropdown-item class="dd_item" icon="el-icon-key"
              >修改密码</el-dropdown-item
            >
            <el-dropdown-item class="dd_item" icon="el-icon-switch-button"
              >退出登录</el-dropdown-item
            >
          </el-dropdown-menu>
        </el-dropdown>
      </div>
    </el-header>
    <el-container>
      <el-aside class="el-aside" width="200px">
        <el-menu text-color="#fff" router background-color="#409eff" active-text-color="#ffd04b">
          <zMenu :list="list"></zMenu>
        </el-menu>
      </el-aside>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import { getNavMenu } from '../api/users'
import zMenu from './navtree/zMenu'

export default {
  name: 'Main',
  created () {
    getNavMenu().then((res) => {
      this.list = res.data.data
    })
  },
  data () {
    return {
      list: []
    }
  },
  components: {
    zMenu
  }
}
</script>

<style lang="less" scoped>
.main_container {
  height: 100%;
}

.el-header {
  background-color: #409eff;
  display: flex;
  justify-content: space-between;
  padding-left: 0;
  color: #ffffff;
  align-items: center;
  font-size: 20px;

  .left_box {
    display: flex;
    align-items: center;

    span {
      margin-left: 50px;
    }
  }
}

.el-dropdown-link {
  cursor: pointer;
  color: #d3ec5d;
}

.el-aside {
  background-color: #409eff;
  color: #333;
  //text-align: center;
  //line-height: 200px;
  //padding-top: 20px;
}

.el-icon-arrow-down {
  font-size: 12px;
}
</style>
